package com.zjtobacco.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.zjtobacco.domain.Region;
import com.zjtobacco.domain.Warehouse;
import com.zjtobacco.service.BaseService;
import com.zjtobacco.service.RegionService;
import com.zjtobacco.service.WarehouseService;

@Controller
@RequestMapping("/region")
public class RegionController extends BaseController<Region, Integer> {
	@Autowired
	private RegionService regionService;
	@Autowired
	private WarehouseService warehouseService;
	public void addDataForEditView(ModelAndView modelAndView) throws Exception {
		List<Warehouse> allWarehouseList = warehouseService.list(null);
		modelAndView.addObject("allWarehouseList",allWarehouseList);
	}

	@Override
	BaseService<Region, Integer> getBaseService() {
		return this.regionService;
	}

}
